#!/bin/bash
#
# nginx		Start up the nginx server daemon
#
# chkconfig: 2345 55 25
# description: SNginx proxy web


### BEGIN INIT INFO
# Provides: nignx
# Required-Start: $local_fs $network $syslog
# Required-Stop: $local_fs $syslog
# Should-Start: $syslog
# Should-Stop: $network $syslog
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: Start up the nginx server daemon
# Description:       Nginx proxy web
### END INIT INFO

#!/bin/bash
python3.6 /var/www/IPTVOPlatform/oplatform/start_script.py
start(){
redis-server &
#source /var/www/venv/bin/activate && cd /var/www/IPTVOPlatform
source /var/www/venv/bin/activate && cd /var/www/IPTVOPlatform && uwsgi --ini uwsgi.ini &
source /var/www/venv/bin/activate && cd /var/www/IPTVOPlatform && daphne -b 127.0.0.1 -p 14100 IPTVOPlatform.asgi:application &
systemctl restart nginx
}

case "$1" in
	start)
		rh_status_q && exit 0
		start
		;;
	*)
		echo $"Usage: $0 {start}"
		RETVAL=2
esac

